﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using Core.Models;

namespace ContactForm.Models
{
    public class ContactFormModel
    {
        [ScaffoldColumn(false)]
        public Guid Id { get; set; }

        [ScaffoldColumn(false)]
        public BusinessUnit BusinessUnit { get; set; }

        [Required(ErrorMessage = "First name is required")]
        [StringLength(127, ErrorMessage = "First name cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [Required(ErrorMessage = "Last name is required")]
        [StringLength(127, ErrorMessage = "Last name cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Last Name")]
        public string LastName { get; set; }

        [Required(ErrorMessage = "Email Address is required")]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "Email address")]
        [StringLength(127, ErrorMessage = "Email must be under 127 characters.")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Subject is required.")]
        [StringLength(127, ErrorMessage = "Subject cannot be more than 127 characters.")]
        [DataType(DataType.Text)]
        [Display(Name = "Subject")]
        public string Subject { get; set; }

        [Required(ErrorMessage = "Message is required.")]
        [StringLength(1000, ErrorMessage = "Message cannot be more than 1000 characters.")]
        [DataType(DataType.MultilineText)]        
        [Display(Name = "Message (1000 characters max)")]
        [AllowHtml]
        public string Message { get; set; }

        [Display(Name = "Opt in to receive promotional materials in email.")]
        public bool OptIn { get; set; }
    }
}